let express = require('express');

let app = express();

app.use(express.json());//解析json格式
app.use(express.urlencoded({ extended: true }));

app.post('/a', (req , res) => {
    //浏览器不能接收post发来的请求

    // 请求体res.body
    // res response  响应
    // req request  请求
    let { user, pass } = req.body; //用来接收user 跟 pass 的数据

    console.log(user , pass);
    
    res.send({ a: 123, b: 456 });
});
app.listen(3000, () => {
    console.log("---------------------服务启动成功--------------")
})                                     